package com.dbappsecurity.jsbridge;

import com.dbappsecurity.jsbridge.Interface.JsPermissionListener;

/**
 * Created by arirus on 2017/8/24.
 */

abstract public class JsPermissionProcessor implements JsPermissionListener {

  private JsPermissionListener listener;

  abstract public void accept(String permissionName);

  public JsPermissionProcessor(JsPermissionListener listener) {
    this.listener = listener;
  }

  @Override
  public void rejected(JsPermissionProcessor processor, String permissionName) {
    if (listener == null) return;
    listener.rejected(processor, permissionName);
  }

  @Override
  public void rejectedNeverAsk(JsPermissionProcessor processor, String permissionName) {
    if (listener == null) return;
    listener.rejectedNeverAsk(processor, permissionName);
  }
}
